package com.ie.api.center.manager.feign;

import com.alibaba.fastjson.JSONObject;
import com.ie.api.center.manager.hystrix.TenantClientHystrix;
import com.xj.common.bean.R;
import com.xj.common.bean.constant.Common;
import com.xj.common.model.Driver;
import com.xj.common.model.Tenant;
import com.xj.common.utils.JsonPaseUtil;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.io.IOException;
import java.util.List;


//定义一个feign接口，通过@FeignClient("服务名")，来指定调用哪个服务
@FeignClient(value = Common.Service.IE_MANAGER_SERVICE_NAME,fallback= TenantClientHystrix.class)
public interface DriverClient {



	@RequestMapping(value = Common.Service.IE_MANAGER_DRIVER+Common.Service.IE_MANAGER_DRIVER_ADD,method = RequestMethod.POST)
	public R<Driver> add(@RequestBody JSONObject jsonParam);

	@RequestMapping(value = Common.Service.IE_MANAGER_DRIVER+Common.Service.IE_MANAGER_DRIVER_DELETE,method = RequestMethod.POST)
	public R<Driver> delete(@RequestBody JSONObject jsonParam);


	@RequestMapping(value = Common.Service.IE_MANAGER_DRIVER+Common.Service.IE_MANAGER_DRIVER_UPDATE,method = RequestMethod.POST)
	public R<Driver> update(@RequestBody JSONObject jsonParam) ;

	@RequestMapping(value = Common.Service.IE_MANAGER_DRIVER+Common.Service.IE_MANAGER_DRIVER_SELECT_BY_ID,method = RequestMethod.POST)
	public R<Driver> selectById(@RequestBody JSONObject jsonParam) ;

	@RequestMapping(value = Common.Service.IE_MANAGER_DRIVER+Common.Service.IE_MANAGER_DRIVER_SELECT_BY_TENANTTID,method = RequestMethod.POST)
	public R<List<Driver>> selectByTenantId(@RequestBody JSONObject jsonParam);

	@RequestMapping(value = Common.Service.IE_MANAGER_DRIVER+Common.Service.IE_MANAGER_DRIVER_SELECT_BY_SERVICENAME,method = RequestMethod.POST)
	public R<Driver> selectByServiceName(@RequestBody JSONObject jsonParam);
}






